import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('@/views/admin/Layout.vue'),
    redirect: '/home',
    children: [
      { path: 'profile', component: () => import('@/views/admin/Profile.vue') },
      { path: 'password', component: () => import('@/views/admin/Password.vue') },
      { path: 'home', component: () => import('@/views/admin/Home.vue') },
      { path: 'user', component: () => import('@/views/admin/User.vue') },
      { path: '/bluetooth', component: () => import('@/views/blueTooth/index.vue') },
      { path: '/rfid', component: () => import('@/views/rfid/index.vue') },
      { path: '/material', component: () => import('@/views/material/index.vue') },
      { path: '/device', component: () => import('@/views/device/index.vue') },
      { path: '/tool', component: () => import('@/views/tool/index.vue') },
      { path: 'device/plc', component: () => import('@/views/admin/DevicePlc.vue') },
      { path: 'device/shelf', component: () => import('@/views/admin/DeviceShelf.vue') },
      { path: 'device/info', component: () => import('@/views/admin/DeviceInfo.vue') },
      { path: 'role', component: () => import('@/views/admin/Role.vue') },
      { path: 'menu', component: () => import('@/views/admin/Menu.vue') },
      { path: 'material/location', component: () => import('@/views/material/Location.vue') },
      { path: 'device/binding', component: () => import('@/views/admin/DeviceBinding.vue') },
       { path: '/operationlog', component: () => import('@/views/admin/operationlog.vue') },
      { path: 'stock/manual', component: () => import('@/views/stock/ManualStock.vue') }
    ]
  },
  { path: '/login', component: () => import('@/views/Login.vue') },
  { path: '/register', component: () => import('@/views/Register.vue') }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router